<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Class</title>
</head>
<body>
<script>
    class Student{
        constructor(name, age, address){
            this.name = name
            this.age =age
            this.address = address
        }
        get(){
            console.log(this.name)
            console.log(this.age)
            console.log(this.address)
        }
    }
    const student1 = new Student("tommy", 24, "beijing")

    function Student2(name, age, address){
        this.name = name
        this.age = age
        this.address = address

        Student2.prototype.getAll = () =>{
        console.log(this.name)
        console.log(this.age)
        console.log(this.address)
    };
    }
    // Student2.prototype.getAll = function getAll(){
    //     console.log(this.name)
    //     console.log(this.age)
    //     console.log(this.address)
    // };
    const student2 = new Student2("tommy", 24, "shanghai")

    student2.getAll()
</script>
</body>
</html>